#ifndef WRITEPAGEVIEW_H
#define WRITEPAGEVIEW_H

#include <QFrame>
#include "ui_writepageview.h"
#include "WPData.h"
#include "wpcustomviewbasicdata.h"

class BlogView;
class ImageWidget;

class WritePageView : public QFrame, public WPCustomViewBasicData
{

    Q_OBJECT

public:
    WritePageView(BlogView *parent = 0);
    ~WritePageView();

private:
    void ResetView(WPPage page);
    void RefreshAddPhotoText();

public:        
    void NewPage(WPDataBlog& aBlog);
    void EditPage(WPDataBlog& aBlog, WPPage aPage);
    void ImagesAdded(const QStringList& aFilenames, const QList<QPixmap>& aThumbnails);
    void VideosAdded(const QStringList& aFilenames);
    
signals:
    void ShowErrorNote(const QString& aError);
    void ShowWarningNote(const QString& aWarning);

public slots:
    void SavePage();
    void AddPhotosClicked(bool aDummy);
    void AddVideosClicked(bool aDummy);
    void setFocus();

private slots:
    void Cancel();
    void RemoveImageWidget(ImageWidget* targetWidget);

private:
    Ui::WritePageView ui;

    BlogView* iParent;

    WPDataBlog* iBlog;
    WPPage iPage;
    
    QStringList iAddedImages;
    QStringList iAddedVideos;
    QList<ImageWidget*> iImageWidgets;

};

#endif // WRITEPAGEVIEW_H
